function insert(editor){    
    var jvtabsForm = $('jvtabsForm');
    if(!jvtabsForm) return false;
               
    var type       = jvtabsForm.type.value.trim();   
    var theme      = jvtabsForm.theme.value.trim();
    var height     = jvtabsForm.height.value.trim();
    var width      = jvtabsForm.width.value.trim();
    
    var fx       = jvtabsForm.fx.value.trim();   
    var transition= jvtabsForm.transition.value.trim();
    var ease     = jvtabsForm.ease.value.trim();
    var duration = jvtabsForm.duration.value.trim();
    var timer    = jvtabsForm.timer.value.trim();
    var wait     = jvtabsForm.wait.value.trim();
    
    var autos       = jvtabsForm.auto;
    for(var i = 0; i < autos.length; i++) {
		if(autos[i].checked) {		  
		  var auto = autos[i].value;
		}
	}
    var ajaxs       = jvtabsForm.ajax;
    for(var i = 0; i < ajaxs.length; i++) {
		if(ajaxs[i].checked) {		  
		  var ajax = ajaxs[i].value;
		}
	}
    
    var text = '';
    
    switch(type){
        case 'k2content':
        case 'content':
            var article    = jvtabsForm.article.value.trim();          
            var categories = jvtabsForm.categories.value.trim();
            var limit      = jvtabsForm.limit.value.trim(); 
            var fulltexts  = jvtabsForm.fulltext; 
            var style      = jvtabsForm.style.value.trim();
             
            for(var i = 0; i < fulltexts.length; i++) {
        		if(fulltexts[i].checked) {		  
        		  var fulltext = fulltexts[i].value;
        		}
        	}
            
            text += '{jvtabs';
            text += ' type="'+type+'"';
            text += article != '' ? ' article="'+article+'"' : '';
            text += categories != '' ? ' categories="'+categories+'"' : '';
            text += ' limit="'+limit+'"';
            text += ' style="'+style+'"';
            text += ' theme="'+theme+'"';            
            text += ' height="'+height+'"';
            text += ' width="'+width+'"';
            text += ' fulltext="'+fulltext+'"';
            text += ' auto="'+auto+'"';
            text += ' ajax="'+ajax+'"';
            text += ' fx="'+fx+'"';
            text += ' transition="'+transition+'"';
            text += ' ease="'+ease+'"';
            text += ' duration="'+duration+'"';
            text += ' timer="'+timer+'"';
            text += ' wait="'+wait+'"';
            text += "}{/jvtabs}";
            
            jInsertEditorText(text, editor);            
            
        break;
        
        case 'modules':
            var module     = jvtabsForm.module.value.trim();
            var moduleid   = jvtabsForm.moduleid.value.trim();
            var style      = jvtabsForm.style.value.trim();
            var modulestyle= jvtabsForm.modulestyle.value.trim();
            
            text += '{jvtabs';
            text += ' type="'+type+'"';
            text += module != '' ? ' module="'+module+'"' : '';
            text += moduleid != '' ? ' moduleid="'+moduleid+'"' : '';
            text += ' modulestyle="'+modulestyle+'"';
            text += ' style="'+style+'"';
            text += ' theme="'+theme+'"';            
            text += ' height="'+height+'"';
            text += ' width="'+width+'"';
            text += ' auto="'+auto+'"';
            text += ' ajax="'+ajax+'"';
            text += ' fx="'+fx+'"';
            text += ' transition="'+transition+'"';
            text += ' ease="'+ease+'"';
            text += ' duration="'+duration+'"';
            text += ' timer="'+timer+'"';
            text += ' wait="'+wait+'"';
            text += "}{/jvtabs}";            
            jInsertEditorText(text, editor);
            
        break;
    }
    
    SqueezeBox.listeners.close();
            
    return false;   
    
}

function switchType(type){
    switch(type){
        case 'k2content':
        case 'content':
             $('prcontent').removeClass('hidden');
             $('prmodule').addClass('hidden');
        break;
        
        case 'modules':
             $('prcontent').addClass('hidden');
             $('prmodule').removeClass('hidden');
        
        break;
    }

}


